import inspect

myglobals = {}
myglobals.update(globals())
modules = [value for key, value in myglobals.items() if inspect.ismodule(value)]
print(modules)